home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.04 Apr 95 / TreeAppƒ / Eric's C++ Libraries / Interface Classes / CPPControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  1.7 KB  |  67 lines  |  [TEXT/KAHL]

  1. /********************************************************* DEFINITION
  2.     DATE:    9/23/93
  3.     AUTHOR: Eric R. Rosé
  4.     
  5.     CLASS:  CPPControl
  6.     
  7.     SUPERCLASS: CPPVisualObject
  8.     
  9.         This C++ class provides an abstract superclass for a 
  10.             generic control
  11.     
  12. ********************************************************************/
  13.  
  14. #pragma once
  15.  
  16. #include <CPPVisualObject.h>
  17.  
  18.  
  19. class CPPControl : public CPPVisualObject {
  20. public:
  21.             CPPControl (CPPWindow *itsWindow, Boolean canBeTarget = FALSE,
  22.                          Boolean active = FALSE, Boolean visible = TRUE);
  23.             CPPControl (CPPWindow *itsWindow, short ResID,
  24.                          Boolean isFramed = FALSE,
  25.                          Boolean canBeTarget = FALSE,
  26.                          Boolean active = FALSE, Boolean visible = TRUE);
  27.             CPPControl (CPPWindow *itsWindow, Rect *itsBounds,
  28.                          short ControlType, StringPtr itsText,
  29.                          Boolean isFramed = FALSE,
  30.                          Boolean useWindowFont = FALSE,
  31.                          Boolean canBeTarget = FALSE,
  32.                          Boolean active = FALSE, Boolean visible = TRUE);
  33.             ~CPPControl (void);
  34.  
  35.     virtual    Boolean    Member (char *className);
  36.     virtual    char     *ClassName (void);
  37.     
  38.     virtual    Boolean    DoClick (EventRecord *theEvent);
  39.  
  40.     virtual    void    Activate (Boolean nowActive);
  41.     virtual    void    MakeVisible (Boolean nowVisible);
  42.     virtual    void    Draw (void);
  43.     
  44.     virtual    void    SetValue (short newValue);
  45.             short    GetValue (void);
  46.             void    SetCallBack (ProcPtr callBack);
  47.     
  48.             Boolean    IsEnabled(void);
  49.     virtual    void    DoOnClick (void);
  50.     virtual    void    FrameControl (Boolean useRoundRect);
  51.     virtual    void    EnableControl (Boolean nowEnabled);
  52.  
  53.     virtual    Rect    *GetBounds (void);
  54.  
  55. protected:
  56.     Boolean            isEnabled;
  57.     Boolean            hasFrame;
  58.     short            myValue;
  59.     ControlHandle    theControl;
  60.     ProcPtr            callBackProc;
  61.  
  62.     virtual    void    MoveContent (short newH, short newV);
  63.     virtual    void    ResizeContent (short newWidth, short newHeight);
  64.  
  65. };
  66.  
  67.